package com.ethink.warehouse.converter;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
import com.ethink.framework.common.converter.Converter;
import com.ethink.warehouse.api.info.LogisticsTraceApplyOrderInfo;
import com.ethink.warehouse.common.entity.LogisticsTraceApplyOrder;

/**
 * 物流跟进申请表 Converter转换器
 *
 * @author default
 * @date 2022-12-15
 */
@Component
public class LogisticsTraceApplyOrderConverter implements Converter<LogisticsTraceApplyOrderInfo, LogisticsTraceApplyOrder> {

    @Override
    public LogisticsTraceApplyOrder convertTo(LogisticsTraceApplyOrderInfo info) {
        if(info == null) {
            return null;
        }
        LogisticsTraceApplyOrder entity = new LogisticsTraceApplyOrder ();
        BeanUtils.copyProperties(info, entity);
        return entity;
    }

    @Override
    public LogisticsTraceApplyOrderInfo convertFrom(LogisticsTraceApplyOrder entity) {
        if(entity == null) {
            return null;
        }
        LogisticsTraceApplyOrderInfo info = new LogisticsTraceApplyOrderInfo();
        BeanUtils.copyProperties(entity, info);
        return info;
    }
}
